package com.corecloud.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.corecloud.entity.SysUserEntity;
import com.corecloud.mapper.mysql.SysUserMapper;
import com.corecloud.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {

    @Autowired
    private SysUserMapper sysUserMapper;


    @Override
    public SysUserEntity selectOne(QueryWrapper<SysUserEntity> paras) {
        SysUserEntity sysUserEntity = sysUserMapper.selectOne(paras);
        return sysUserEntity;
    }

    @Override
    public List<SysUserEntity> selectList(QueryWrapper<SysUserEntity> qw) {
        return sysUserMapper.selectList(qw);
    }

    @Override
    public List<Map<String, Object>> selectMap(QueryWrapper<SysUserEntity> qw) {
        return sysUserMapper.selectMaps(qw);
    }

    @Override
    public Page<SysUserEntity> getInfoByPage(Page page, QueryWrapper<SysUserEntity> qw) {return sysUserMapper.selectPage(page,qw); }

    @Override
    public void updateInfo(SysUserEntity info) {
        sysUserMapper.updateById(info);
    }

    @Override
    public void updateUserIsValid(Map<String, Object> map) { sysUserMapper.updateUserIsValid(map);}

    @Override
    public void deleteInfo(Integer id) {
        sysUserMapper.deleteById(id);
    }

    @Override
    public Integer insertInfo(SysUserEntity info) {
        return sysUserMapper.insert(info);
    }
}